package com.study.spring.boot.controller;

import com.study.spring.boot.model.entity.User;
import com.study.spring.boot.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: UserController
 * @Description: TODO
 * @author: limingxing
 * @Date: 2021/1/10  17:06
 */
@RestController
public class UserController {
    @Autowired
    private IUserService userService;

    @PostMapping("/users")
    public User addUser(@RequestBody User u){
        return userService.add(u);
    }
}
